
export default {
  namespaced: true,
  state: {
    token: localStorage.getItem('token') || ''
  },
  mutations: {
    login(state) {
      state.token = 123456
      localStorage.setItem('time', Date.now())
      localStorage.setItem('token', 123456)
    },
    removeToken(state) {
      state.token = ''
      localStorage.removeItem('token')
      localStorage.removeItem('time')
    }

  },
  actions: {
    logout(context) {
      context.commit('removeToken')
    }
  }
}

